/************************************************************
 * Copyright (C), 2022-2030, ripnano. Co., Ltd.
 * FileName:        form_setting.h
 * Author:          Dan Yin
 * Date:            2024-03-04
 * Description:     the class of setting page
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_SETTING_H
#define FORM_SETTING_H

// add necessary includes here
#include "ui/defines/global.h"

namespace Ui {
class FormSetting;
}

class FormSetting : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormSetting" class, if exist, return it
    static FormSetting* getInstance(QWidget *pParent = nullptr);

    // The default destructor
    virtual ~FormSetting();

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

signals:
    // The signal that refresh UI info
    void signalRefreshUI();

    // Show the mode window
    void signalShowPageMode();

    // Show the language page
    void signalShowPageLanguage();

    // Show the datetime page
    void signalShowPageDatetime();

    // Show the network window
    void signalShowPageNetwork();

    // Show the log window
    void signalShowPageLog();

    // Show the version page
    void signalShowPageVersion();

    // Show the upgrade page
    void signalShowPageUpgrade();

    // Show the data tools window
    void signalShowPageDataTools();

private slots:
    // The slot that refresh UI info
    void slotRefreshUI();

    void on_pushButton_Mode_clicked();

    void on_pushButton_Language_clicked();

    void on_pushButton_Datetime_clicked();

    void on_pushButton_Network_clicked();

    void on_pushButton_Log_clicked();

    void on_pushButton_Version_clicked();

    void on_pushButton_Upgrade_clicked();

    void on_pushButton_DataTools_clicked();

private:
    // The default constructor
    FormSetting(QWidget *parent = nullptr);

    // After constructing object, initialize the object
    void _initialze();

    // Init the window style
    void _initUi();

private:
    Ui::FormSetting *ui;
};

#endif // FORM_SETTING_H
